package com.shenw.sedit.gui;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

public class SEditFrame extends JFrame {

	private static final long serialVersionUID = 4749778868812046410L;

	public SEditFrame() {
		/* MenuBar */
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		JMenu fileMenu = new JMenu("File");
		menuBar.add(fileMenu);
		JMenu editMenu = new JMenu("Edit");
		menuBar.add(editMenu);
		JMenu helpMenu = new JMenu("Help");
		menuBar.add(helpMenu);
		
		JMenuItem openItem = new JMenuItem("Open");
		fileMenu.add(openItem);
		openItem.addActionListener(new FileOpenListener());
		fileMenu.addSeparator();
		JMenuItem closeItem = new JMenuItem("Close");
		fileMenu.add(closeItem);
		closeItem.addActionListener(new FileCloseListener());
		
		// TODO
		JMenuItem todoItem = new JMenuItem("TODO");
		editMenu.add(todoItem);
		
		JMenuItem aboutItem = new JMenuItem("About sEdit");
		helpMenu.add(aboutItem);
	}
	
	public static void main(String[] args) {
		SEditFrame sew = new SEditFrame();
		sew.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		sew.setVisible(true);
		sew.setSize(400, 500);
		sew.setLocation(200, 200);
	}
}
